package com.lsu.app.bean;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import java.io.Serializable;

import java.time.LocalDateTime;
import java.util.Date;

import com.lsu.app.tool.jwtUtil;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * 日志表
 * @Date 2023-10-18 14:48:43
 * @author hjj
 */
@Data
@TableName("log")
@ApiModel(value="Log对象", description="日志表")
public class Log implements Serializable {

    @NotNull(message="[]不能为空")
    @ApiModelProperty("")
    private Integer id;

    @NotBlank(message="[操作角色账号]不能为空")
    @Size(max= 48,message="编码长度不能超过48")
    @ApiModelProperty("操作角色账号")
    private String username;

    @NotBlank(message="[操作类型（增删查改，登录登出）]不能为空")
    @Size(max= 20,message="编码长度不能超过20")
    @ApiModelProperty("操作类型（增删查改，登录登出）")
    private String type;

    @Size(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("可存储数据")
    private String value;

    @ApiModelProperty("创建时间")
    private String createTime;

    @Size(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("备注")
    private String remake;

    public Log(String username,String type, String value,String remake) {
        this.username = username;
        this.type = type;
        this.value = value;
        this.createTime = LocalDateTime.now().toString();
        this.remake = remake;
    }
}
